package au.com.handsunited.model.photos;

import java.util.HashSet;
import java.util.Set;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import au.com.handsunited.model.BaseEntity;
import au.com.handsunited.model.MotherOfAllEntities;

/**
 *
 * @author arunda
 */
public class Album extends MotherOfAllEntities {

	private String name;
	private String description;
	private BaseEntity owner;
	private BaseEntity lastUpdatedBy;
	private Set<Photo> photos;

	private static Logger logger = LoggerFactory.getLogger(Album.class);

	/**
	 *
	 */
	public Album() {
		super();
		photos = new HashSet<Photo>();
	}

	public Album(BaseEntity owner) {
		this();
		this.owner = owner;
	}


	public void addPhoto(Photo photo) {
		photo.setAlbum(this);
		photos.add(photo);
	}

	public boolean removePhoto (Photo photo) {
		if (photos.contains(photo)) {
			photos.remove(photo);
			return true;
		} else {
			return false;
		}
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public BaseEntity getOwner() {
		return owner;
	}

	public void setOwner(BaseEntity owner) {
		this.owner = owner;
	}

	public Set<Photo> getPhotos() {
		return photos;
	}

	public void setPhotos(Set<Photo> photos) {
		this.photos = photos;
	}

	public BaseEntity getLastUpdatedBy() {
		return lastUpdatedBy;
	}

	public void setLastUpdatedBy(BaseEntity lastUpdatedBy) {
		this.lastUpdatedBy = lastUpdatedBy;
	}

}

